using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BikyBall.Graphic
{
    public static class ModelConstructor
    {
        public static GraphicProperty Construct(String ModelName, Shader shader)
        {
            GraphicProperty gp = new GraphicProperty();
            gp.Model = GraphicEngine.Content.Load<Model>(ModelName);
            gp.Shader = shader;
            if (shader == Shader.TOON_SHADE)
            {
                gp.ModelBlack = GraphicEngine.Content.Load<Model>(ModelName + "black");
                foreach (ModelMesh m in gp.ModelBlack.Meshes)
                    foreach (ModelMeshPart mm in m.MeshParts)
                    {
                        ((BasicEffect)mm.Effect).DiffuseColor = Vector3.Zero;
                    }
            }
            return gp;
        }
    }
}
